Ext.define("app.file.form", {
	extend : 'Ext.window.Window',
	title : '上传附件',
	height : 300,
	width : 400,
	closable : true,
	resizable : false,
	modal : true,
	constrain : true,
	plain : true,
	layout : {
		type : 'border'
	},
	initComponent : function() {
		var me = this;
		me.form = me.createForm();
		Ext.apply(me, {
			items : [ me.form ],
			buttons : [ {
				text : '确认',
				bodyStyle : 'padding:0 0 0 5px',
				handler : function() {
					me.submitForm();
				}
			}, {
				text : '关闭',
				bodyStyle : 'padding:0 0 0 5px',
				handler : function() {
					me.close();
				}
			} ]
		});
		me.callParent(arguments);
	},
	submitForm : function() {
		var me = this;
		evt.submit(me.form, systemUrl + '/boyon/file', {}, function() {

		});
	},
	loadData : function(form) {

	},
	createForm : function() {
		var me = this;
		var fields = me.createField();
		var form = Ext.create('Ext.form.Panel', {
			layout : 'column',
			region : 'center',
			items : fields
		});
		return form;
	},
	createField : function() {
		var me = this;
		var array = new Array();
		utils.pushfieldarray(array, '1', {
			name : 'fileName',
			beforeLabelTextTpl : required,
			fieldLabel : '文件名称'
		});
		utils.pushfieldarray(array, '6', {
			name : 'remark',
			beforeLabelTextTpl : required,
			fieldLabel : '描述'
		});
		utils.pushfieldarray(array, '4', {
			name : 'businessType'
		});
		utils.pushfieldarray(array, '4', {
			name : 'relationId'
		});
		utils.pushfieldarray(array, '7', {
			name : 'file',
			beforeLabelTextTpl : required,
			fieldLabel : '上传附件'
		});
		return array;
	}
});